//
//  PXTableObject.h
//  MacStockApp
//
//  Created by 英傑 翁 on 12/2/10.
//  Copyright (c) 2012年 翁英傑. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Data_Object.h"
#import "RLTableColumnHeader.h"

@interface PXTableObject : NSObject<NSCoding>{
    
    NSMutableArray *data_array_node; //存放節點從下層資料往上彙整的總和資料  (陣列內存放的是:NSMutableDictionary )  
    
    NSMutableArray *data_array_object; //單一股票資料 通用資料所有的表格都通用的資料 (陣列內存放的是:Data_Object )
    
    NSMutableArray *data_array_onlyfortableObject; //存放的都是僅在此單一表格使用的資料 如股票買入數量 (陣列內存放的是:NSMutableDictionary )
    NSMutableDictionary *data_dic_onlyfortableObject; //存放的都是僅在此單一表格合計的資料 如股票買入數量合計  
    
}
 
@property (nonatomic, retain)   NSMutableArray *data_array_object;
@property (nonatomic, retain)   NSMutableArray *data_array_node; 
@property (nonatomic, retain)   NSMutableArray *data_array_onlyfortableObject;
@property (nonatomic, retain)   NSMutableDictionary *data_dic_onlyfortableObject;

//單一股票資料
-(NSUInteger)index_data_arrary_object_from_code:(NSString *)code;
-(Data_Object *)object_data_arrary_object_from_code:(NSString *)code;

//data_array_object排序
-(void)sort_data_array_object_table_column_object_array:(RLTableColumnHeader *)table_column_object_array  identfiler_table_column:(NSString *)set_identfiler_table_column  sort_direction:(NSString *)direction isSort_Node_para:(BOOL) isSort_Node_para;

//存放節點從下層資料往上彙整的總和資料
-(NSUInteger)index_data_arrary_node_from_code:(NSString *)code;
-(NSMutableDictionary *)object_data_arrary_node_from_code:(NSString *)code;
 
//存放的都是僅在此表格使用的資料
-(NSUInteger)index_data_arrary_only_for_table_from_code:(NSString *)code;
-(NSMutableDictionary *)object_data_arrary_only_for_table_from_code:(NSString *)code;

//計算特定欄位與股票
-(void)calculate_table_byarray_all:(NSString *)column_item;
-(void)calculate_table_byarray:(NSString *)column_item code:(NSString *)code;


//針對表格總和的特定欄位值的統計值進行計算
-(void)calculate_table_sum:(NSString *)key column_item:(NSString *)column_item locationPath:(NSString *)locationpath index_before:(int)index_before;

 
-(void)calcuate_table_position_sum_average_all:(NSMutableArray *)table_column_data barcount:(int)barcount data_titles:(NSArray *)data_titles;


//輸出 表格上的-部位-欄位
-(NSMutableArray *)output_table_column_all:(NSMutableArray *)all_table_column_data table_column_single:(NSMutableDictionary *)table_column_single output_data:(NSMutableDictionary *)output_data;

@end
